Conversation
jelly
requested changes
Sep 19, 2026
| return value.days * 24 * 3600 + value.seconds | ||
|
|
||
|
|
||
| def _td_seconds_or_none(value) -> int | None: |
Member
There was a problem hiding this comment.
This is a datetime no? So can be typed as such. Same as above.
| def _url_to_schema(url) -> MirrorUrlSchema: | ||
| return MirrorUrlSchema( | ||
| url=url.url, | ||
| protocol=str(url.protocol), |
Member
There was a problem hiding this comment.
This is url.protocol.protocol, yes a bit confusing
| return MirrorUrlWithLogsSchema(**base.dict(), logs=logs) | ||
|
|
||
|
|
||
| @router.get("/status/", response=MirrorStatusSchema, url_name="mirror-status") |
Member
There was a problem hiding this comment.
Hmm this one is missing @cache_control(max_age=311)
|
|
||
|
|
||
| @router.get("/pkgbase-maintainer", response=dict[str, list[str]], url_name="pkgbase-maintainer") | ||
| def pkgbase_maintainer(request): |
Member
There was a problem hiding this comment.
This endpoint was cached before max_age=300
| router = Router(tags=["public"]) | ||
|
|
||
|
|
||
| @router.get("/", response=PGPKeysSchema, url_name="pgp-keys") |
Member
There was a problem hiding this comment.
This was cached before @cache_page(1789)
jelly
reviewed
Sep 19, 2026
| # Same as with /todo/{slug}/json | ||
| todolist = get_object_or_404(Todolist, slug=slug) | ||
| to_json = json.dumps(todolist, ensure_ascii=False, cls=TodoListJSONEncoder) | ||
| return HttpResponse(to_json, content_type='application/json') |
Member
There was a problem hiding this comment.
Why does this not use the django-ninja stuff?
inglor
force-pushed
the
openapi
branch
2 times, most recently
from
September 19, 2026 16:07
c09ee57 to
fe9f8fd
Compare
Closes part of archlinux#199 Signed-off-by: Leonidas Spyropoulos <artafinde@archlinux.org>
Signed-off-by: Leonidas Spyropoulos <artafinde@archlinux.org>
Extend the Django Ninja API to cover the remaining public read-only JSON endpoints under /api/v1/ Closes part of archlinux#199. Closes archlinux#532. Signed-off-by: Leonidas Spyropoulos <artafinde@archlinux.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.